{% load i18n %}
{% load app_tags %}

{% get_current_language as LANGUAGE_CODE %}

<nav class="navbar navbar-expand-lg navbar-dark fixed-top">
    <div class="container-fluid">
        <a class="navbar-brand" href="/{% if LANGUAGE_CODE != 'zh' %}en{% else %}zh{% endif %}"><img src="/static/visualdl/images/logo.svg"/></a>
        <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent"
                aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
            <span class="navbar-toggler-icon"></span>
        </button>

        <div class="collapse navbar-collapse" id="navbarSupportedContent">
            <ul class="navbar-nav ml-auto">
                <li class="nav-item{% if '/documentation' in request.path %} active{% endif %}">
                    <a class="nav-link" href="/documentation/{% if LANGUAGE_CODE != 'zh' %}en{% else %}zh{% endif %}"{% if settings.ENV != 'production' and settings.ENV != 'staging' %} onclick="return showFullpageSpinnerForContentId('documentation');"{% endif %}>{% trans "Documentation" %}<span class="sr-only">(current)</span></a>
                </li>
                <li><a class="nav-link" href="https://github.com/PaddlePaddle/VisualDL">
                    GitHub
                </a></li>
                <li>
                    {% setup_vdl_context as additional_context %}
                    <a class="nav-link" href="{{ additional_context.lang_def.link }}">{{ additional_context.lang_def.label }}</a>
                </li>
            </ul>
        </div>
    </div>
</nav>
